package com.hksj.ecm.controller;

import com.hksj.cbm.vo.LargeScreenDeviceModelVO;
import com.hksj.common.core.model.Rest;
import com.hksj.ecm.dto.EnergyCockpitBaseDTO;
import com.hksj.ecm.dto.EnergyCockpitDTO;
import com.hksj.ecm.dto.EnergyConsumptionCostDTO;
import com.hksj.ecm.service.EnergyCockpitService;
import com.hksj.ecm.vo.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import java.util.List;

/**
 * @author fjt
 * @data 2024/8/8 16:53
 * @describe 能耗监测驾驶舱
 */
@Api(tags = "能耗监测-驾驶舱")
@RestController
@RequestMapping("/api/ecm/cockpit")
public class EnergyCockpitController {

    @Autowired
    private EnergyCockpitService energyCockpitService;


    @PostMapping("/overView")
    @ApiOperation(value = "设备概览", notes = "设备概览",response = EnergyDeviceOverviewVO.class)
    public Rest<List<EnergyDeviceOverviewVO>> deviceOverView(@RequestBody EnergyCockpitBaseDTO dto){
        return Rest.ok(energyCockpitService.deviceOverView(dto));
    }


    @PostMapping("/energyTrend")
    @ApiOperation(value = "能耗趋势查询", notes = "能耗趋势查询",response = EnergyTrendVO.class)
    public Rest<List<EnergyTrendVO>> energyTrend(@RequestBody @Valid EnergyCockpitDTO dto){
        return Rest.ok(energyCockpitService.energyTrend(dto));
    }


    @PostMapping("/energyProportion")
    @ApiOperation(value = "能耗占比分析", notes = "能耗占比分析",response = EnergyProportionVO.class)
    public Rest<List<EnergyProportionVO>> energyProportion(@RequestBody @Valid EnergyCockpitDTO dto){
        return Rest.ok(energyCockpitService.energyProportion(dto));
    }


    @PostMapping("/listTopTen")
    @ApiOperation(value = "能耗排名top10", notes = "能耗排名top10",response = EnergyTopTenVo.class)
    public Rest<EnergyTopTenVo> listTopTen(@RequestBody @Valid EnergyCockpitDTO dto){
        return Rest.ok(energyCockpitService.listTopTen(dto));
    }


    @PostMapping("/energyConsumptionCost")
    @ApiOperation(value = "能耗费用", notes = "能耗费用(驾驶舱页面中间费用计算接口)",response = EnergyConsumptionCostVO.class)
    public Rest<EnergyConsumptionCostVO> energyConsumptionCost(@RequestBody @Valid EnergyConsumptionCostDTO dto){
        return Rest.ok(energyCockpitService.energyConsumptionCost(dto));
    }

    @ApiOperation(value = "查询能耗大屏绑定的设备列表")
    @PostMapping("/queryEnergyCockpitBindDeviceModelList")
    public Rest<List<LargeScreenDeviceModelVO>> queryEnergyCockpitBindDeviceModelList(@RequestBody EnergyConsumptionCostDTO dto){
        return Rest.ok(energyCockpitService.queryEnergyCockpitBindDeviceModelList(dto));
    }


}
